package com.yanftch.stopcoding;

import com.intellij.openapi.application.ApplicationManager;
import com.yanftch.stopcoding.bean.HotBean;
import com.yanftch.stopcoding.common.util.LogUtil;
import com.yanftch.stopcoding.manager.NotifyManager;
import com.yanftch.stopcoding.utils.FileUtils;

import java.util.ArrayList;
import java.util.List;

public class BaseApplicationComponent implements IApplicationComponent {
    private static final String TAG = "debug_BaseApplicationComponen";
    public static List<HotBean> list = new ArrayList<>();

    public BaseApplicationComponent() {
        ApplicationManager.getApplication().invokeLater(() -> {
            LogUtil.d(TAG, "IDE启动，插件初始化。。。开始");
            NotifyManager.init();
            LogUtil.d(TAG, "IDE启动，插件初始化。。。结束");
            new Thread(new Runnable() {
                @Override
                public void run() {
                    List<HotBean> list1 = FileUtils.getList();
                    list = list1;
                }
            }).start();
        });
    }
}
